/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gla.centralhotel.dao.interfaces;

import gla.centralhotel.exception.CollectionRetrieverException;
import gla.centralhotel.exception.IllegalAuthenticationException;
import gla.centralhotel.exception.ManagerSubscriptionException;
import gla.centralhotel.exception.NoUserFoundException;
import gla.centralhotel.model.Country;
import gla.centralhotel.model.Manager;
import gla.centralhotel.model.Zipcode;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Local;
import javax.persistence.NoResultException;
import javax.persistence.NonUniqueResultException;

/**
 *
 * @author Rivo
 */
@Local
public interface IManagerDAO {

    void remove(Manager manager);

    Manager find(Object id);

    List<Manager> findAll();
    
    public Manager findManagerByEmail(String email) throws NoUserFoundException;
    
    /**
     * Identifie l'utilisateur par "login - password"
     * @param email
     * @param pwd
     * @return
     * @throws javax.persistence.NoResultException
     * @throws javax.persistence.NonUniqueResultException
     */
    public Manager findManagerByEmailPassword(String email, String pwd) throws IllegalAuthenticationException;
    
    /**
     * MAJ Infor manager d'hotel
     * @param manager
     * @return
     */
    public Manager updateManager(Manager manager)throws ManagerSubscriptionException, IllegalAuthenticationException;
    
    /**
     * Ajoute un manager d'hotel et vérifie l'unicité du mail (mot de implicite)
     * @param manager
     * @return
     */
    Manager saveManager(Manager manager)throws ManagerSubscriptionException, IllegalAuthenticationException;
    
    /**
     * Permet de recuperer une collection de manager d'hotel en passant en parametre
     * un country
     * @param country
     * @return
     * @throws gla.centralhotel.exception.CollectionRetrieverException
     */
    public ArrayList<Manager> getAllManagerByCountry(Country country) throws CollectionRetrieverException;

    /**
     * Permet de recuperer une collection de manager d'hotel en passant en parametre
     * un zipcode
     * @param zipcode
     * @return
     * @throws gla.centralhotel.exception.CollectionRetrieverException
     */
    public ArrayList<Manager> getAllManagerByZipcode(Zipcode zipcode) throws CollectionRetrieverException;

}
